<meta charset="utf-8">

<div class="box box-primary" id="pmpTasks_split">

<form role="form" id="editForm">
	
		<div class="box box_body">
		
			<div class="row">
			
			    <div class="col-lg-1"></div>
			
				<div class="col-lg-5">
				
					<div class="form-group">
						<label for="title">任务名称</label> 
						<input type="text" name="taskName" v-model="pmpTasks.taskName" class="form-control" id="taskName" required />
					</div>
					
					<div class="form-group">
						<label for="title">评估时间（分钟）</label> 
						<input type="text" name="assignHours" v-model="pmpTasks.assignHours" class="form-control" id="assignHours"/>
					</div>
					
					<div class="form-group">
						<label for="title">截止时间</label>  
						<div class='input-group date' id='datetimepicker'> 
                             <input type='text' class="form-control" id="expiryTime" v-model="pmpTasks.expiryTime" /> 
                             <span class="input-group-addon"> 
                                  <span class="glyphicon glyphicon-calendar"></span> 
                             </span> 
                       </div>
                   </div>
					
					
				</div><!-- /.col-lg-5 -->
				
 

				<div class="col-lg-5">
				   
				   <div class="form-group">
						<label for="title">任务负责人</label> 
						<select type="text" name="chargeUserId" class="form-control" id="chargeUserId" v-model="pmpTasks.chargeUserId"
							v-kselect="{url:'/pmp/service/ma/pmpCloudMember/loadCloudMemberComboboVo',vmodel:'pmpTasks.chargeUserId',firstEmpty:'true'}">
						</select>
					</div>
				   
				   <div class="form-group">
						<label for="title">难度系数</label>
						 <select id="difficultyScoreId" name="difficultyScoreId" v-model="pmpTasks.difficultyScoreId" class=" form-control"
							v-kselect="{url:'/pmp/service/pub/pmpALine/loadDifScoreComboboVo',vmodel:'pmpTasks.difficultyScoreId',firstEmpty:'true'}">
						</select>
					</div>
					
					<div class="form-group">
						<label for="title"> 优先级</label> 
						<select v-model="pmpTasks.priority" id="priority" name="priority" class="form-control" required>
							<option value="1">低</option>
							<option value="2">中等</option>
							<option value="3">急</option>
							<option value="4">加急</option>
						</select>
					</div>
					
				</div><!-- /.col-lg-5 -->
				
				
		</div><!-- /.row -->
			

		
		<div class="row">
		
		<div class="col-lg-1"></div>
		
		<div class="col-lg-10">
		   <div class="form-group">
				<label for="title">任务详情</label>
				<textarea rows="" cols="" name="taskDetail" v-model="pmpTasks.taskDetail" class="form-control" id="taskDetail" required>
				</textarea>
			</div>
		</div>
		</div><!-- /.row -->
     
     </div><!-- /.box-body -->
     
     <div class="box-footer">
         <div class="col-lg-2"></div>
         <div class="col-lg-8">
	        <button type="button" class="btn btn-default" v-on:click="cancle">取消</button>
	        <button type="button" class="btn btn-info pull-right" v-on:click="add">提交</button>
	     </div>
     </div>
   
   </form>
 
</div>



<script type="text/javascript">

$(function(){$('#datetimepicker').datetimepicker({
    format: "yyyy-mm-dd hh:ii",
    autoclose: true,
    todayBtn: true,
    language:'zh-CN',
    pickerPosition:"bottom-left"
  });
});

	var news = new Vue({
		el : '#pmpTasks_split',
		data : {
			pmpTasks : {
				taskId : null,
				taskName : null,
				taskDetail : null,
				expiryTime : null,
				chargeUserId : null,
				assignHours : null,
				difficultyScoreId : null,
				priority : null
			},
			bus : new Vue(),
		},
		mounted : function() {
			var _this = this;
			var param = zfesLayerEditDg.getLayerParam();//taskId 
			_this.pmpTasks.taskId = param.taskId;
		},
		methods : {
			add : function() {
				if ($("#editForm").valid()) {
					let _this = this;
					let url = "/pmp/service/pm/pmpTasks/addOnesplitPmpTasks";
					zfesAjax.ajaxTodo(url, _this.$data.pmpTasks,
							function(data) {
								alertSwal.successText(data.message);
								layer.close(layer.index);
							});
				}
			},
			cancle : function() {
				layer.close(layer.index);
			}
		}
	});
</script>
